using System.ComponentModel;

namespace VSSDKAssist.Recipes.Common.Editors.Grid
{
    /// <summary/>
    public class RequiredConverter : TypeConverter
    {
        /// <summary>
        /// Returns whether the given value object is valid for this type and for the specified context.
        /// </summary>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"></see> that provides a format context.</param>
        /// <param name="value">The <see cref="T:System.Object"></see> to test for validity.</param>
        /// <returns>
        /// true if the specified value is valid for this object; otherwise, false.
        /// </returns>
        public override bool IsValid(ITypeDescriptorContext context, object value)
        {
            return !string.IsNullOrEmpty(value as string);
        }
    }
}